package net.xdclass.order.service;

import net.xdclass.common.JsonData;
import net.xdclass.common.enums.ProductOrderStateEnum;
import net.xdclass.common.message.MessageInfo;
import net.xdclass.order.enums.ProductOrderPayTypeEnum;
import net.xdclass.order.model.ProductOrderDO;
import com.baomidou.mybatisplus.extension.service.IService;
import net.xdclass.order.model.request.ComfirmOrderRequest;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yaya
 * @since 2023-12-31
 */
public interface ProductOrderService extends IService<ProductOrderDO> {

    /**
     * 提交订单
     * @param order
     * @return
     */
    JsonData comfirmOrder(ComfirmOrderRequest order);

    /**
     * 查询订单状态
     * @param outTradeNo
     * @return
     */
    ProductOrderStateEnum selectOrderState(String outTradeNo);

    /**
     * 关闭订单
     * @param messageInfo
     * @return
     */
    boolean closeOrder(MessageInfo messageInfo);

    /**
     * 处理支付回调
     * @param payType
     * @param params
     * @return
     */
    JsonData handleOrderCallback(ProductOrderPayTypeEnum payType, Map<String, String> params);

    /**
     * 查询我的订单
     * @param page
     * @param size
     * @param state
     * @return
     */
    JsonData page(int page, int size, ProductOrderStateEnum state);
}
